#include<stdio.h>
#include<windows.h>
int main()
{
	int x = 5, y = 5, i, j;
	int v1 = 1, v2 = 1;
	while (1)
	{
		system("cls");
		for (i = 1; i <= y; i++)
		{
			for (j = 1; j <= 31; j++)
				printf(" ");
			printf("|\n");
		}

		for (j = 1; j <= x; j++)
			printf(" ");
		printf("o");
		for (i = 1; i <= 30 - x; i++)
			printf(" ");
		printf("|\n");
		for (i = 1; i <= 10 - y; i++)
		{
			for (j = 1; j <= 31; j++)
				printf(" ");
			printf("|\n");
		}

		for (i = 1; i <= 31; i++)
			printf("-");
		printf("|\n");

		y += v1;
		x += v2;

		Sleep(100);
		if (y == 10 || y == 0)
		{
			putchar('\a');
			v1 = -v1;
		}

		if (x == 30 || x == 0)
		{
			putchar('\a');
			v2 = -v2;
		}

	}
	return 0;
}